using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using T2.WebSecurity.Data.Entities.Interfaces;
using T2.WebSecurity.Data.Entities;
using T2.WebSecurity.Business.Entities.Interfaces;
using T2.WebSecurity.Business.Entities;
using T2.WebSecurity.Business.Entities.Search.Interfaces;
using T2.WebSecurity.Data.Entities.Search.Interfaces;
using T2.WebSecurity.Data.Entities.Search;


//--Change Management Control - UserProfile Business Translator  --**********************
//--Created By: trooks
//--Description: UserProfile Translator
//--Created Date: 03/07/2013 10:48:33
//--*************************************************************

namespace T2.WebSecurity.Business.Translators
{
	public static class UserProfileTranslator 
	{
		public static IUserProfile TranslateToDataLayer(IUserProfile_biz _translateFrom)
        {
            IUserProfile temp = new UserProfile();

		
			if(_translateFrom != null)
			{
			temp.Action = _translateFrom.Action;
			temp.Caller = _translateFrom.Caller;
			temp.Role = _translateFrom.Role;
			temp.PageSize = _translateFrom.PageSize;
			temp.PageNumber = _translateFrom.PageNumber;
			temp.SortColumn = _translateFrom.SortColumn;
			temp.SortType = _translateFrom.SortType;
			temp.TotalRows = _translateFrom.TotalRows;
			temp.UserId = _translateFrom.UserId;
			temp.UserName = _translateFrom.UserName;
			temp.TS = _translateFrom.TS;
			temp.CreatedBy = _translateFrom.CreatedBy;
			temp.CreatedDt = _translateFrom.CreatedDt;
			temp.ModifiedBy = _translateFrom.ModifiedBy;
			temp.ModifiedDt = _translateFrom.ModifiedDt;
			temp.IsActive = _translateFrom.IsActive;
			temp.FirstName = _translateFrom.FirstName;
			temp.LastName = _translateFrom.LastName;
			temp.Address = _translateFrom.Address;
			temp.City = _translateFrom.City;
			temp.Region = _translateFrom.Region;
			temp.PostalCode = _translateFrom.PostalCode;
			temp.OfficePhone = _translateFrom.OfficePhone;
			temp.CellPhone = _translateFrom.CellPhone;
			temp.Title = _translateFrom.Title;
			}
            return temp;
        }
		
		public static IUserProfileSearch TranslateSearchToDataLayer(IUserProfileSearch_biz _translateFrom)
        {
            IUserProfileSearch temp = new UserProfileSearch();
		
			if(_translateFrom != null)
			{
			temp.Action = _translateFrom.Action;
			temp.Caller = _translateFrom.Caller;
			temp.Role = _translateFrom.Role;
			temp.PageSize = _translateFrom.PageSize;
			temp.PageNumber = _translateFrom.PageNumber;
			temp.SortColumn = _translateFrom.SortColumn;
			temp.SortType = _translateFrom.SortType;
			temp.TotalRows = _translateFrom.TotalRows;
			temp.UserName = _translateFrom.UserName;
			temp.FirstName = _translateFrom.FirstName;
			temp.LastName = _translateFrom.LastName;
			temp.Address = _translateFrom.Address;
			temp.City = _translateFrom.City;
			temp.Region = _translateFrom.Region;
			temp.PostalCode = _translateFrom.PostalCode;
			temp.OfficePhone = _translateFrom.OfficePhone;
			temp.CellPhone = _translateFrom.CellPhone;
			temp.Title = _translateFrom.Title;
			}
            return temp;
        }

        public static IUserProfile_biz TranslateFromDataLayer(IUserProfile _translateFrom)
        {
            IUserProfile_biz temp = new UserProfile_biz();
			if(_translateFrom != null)
			{
			temp.Action = _translateFrom.Action;
			temp.Caller = _translateFrom.Caller;
			temp.Role = _translateFrom.Role;
			temp.PageSize = _translateFrom.PageSize;
			temp.PageNumber = _translateFrom.PageNumber;
			temp.SortColumn = _translateFrom.SortColumn;
			temp.SortType = _translateFrom.SortType;
			temp.TotalRows = _translateFrom.TotalRows;
			temp.UserId = _translateFrom.UserId;
			temp.UserName = _translateFrom.UserName;
			temp.TS = _translateFrom.TS;
			temp.CreatedBy = _translateFrom.CreatedBy;
			temp.CreatedDt = _translateFrom.CreatedDt;
			temp.ModifiedBy = _translateFrom.ModifiedBy;
			temp.ModifiedDt = _translateFrom.ModifiedDt;
			temp.IsActive = _translateFrom.IsActive;
			temp.FirstName = _translateFrom.FirstName;
			temp.LastName = _translateFrom.LastName;
			temp.Address = _translateFrom.Address;
			temp.City = _translateFrom.City;
			temp.Region = _translateFrom.Region;
			temp.PostalCode = _translateFrom.PostalCode;
			temp.OfficePhone = _translateFrom.OfficePhone;
			temp.CellPhone = _translateFrom.CellPhone;
			temp.Title = _translateFrom.Title;
			}
            return temp;
        
        }
	
	}
	
}
